home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / Xconq 7.0d37 / lib / flattop.g < prev    next >
Text File  |  1995-05-04  |  5KB  |  244 lines

  1. (game-module "flattop"
  2.   (title "Flattop Battles")
  3.   (blurb "WW II, in the Pacific, aboard a carrier")
  4.   (variants (see-all false))
  5.   )
  6.  
  7. (unit-type f (name "fighter")
  8.   (help "protects ships from aircraft"))
  9. (unit-type d (name "dive bomber") (help ""))
  10. (unit-type t (name "torpedo bomber")
  11.   (help "carries deadly torpedos"))
  12. (unit-type pby (name "PBY") (char "p")
  13.   (help "long-range scout plane"))
  14. (unit-type dd (name "destroyer") (char "D") (help ""))
  15. (unit-type sub (name "submarine") (char "S") (help ""))
  16. (unit-type cve (name "escort carrier") (char "E") (help ""))
  17. (unit-type cl (name "light cruiser") (char "R") (help ""))
  18. (unit-type ca (name "heavy cruiser") (char "R") (help ""))
  19. (unit-type cv (name "carrier") (char "C") (help ""))
  20. (unit-type bb (name "battleship") (char "B") (help ""))
  21. (unit-type / (name "base") (help ""))
  22.  
  23. (material-type fuel (help "how to get around"))
  24. (material-type ammo (help "small stuff"))
  25. (material-type shell (help "8 to 16 inch"))
  26. (material-type bomb (help "iron bombs"))
  27. (material-type torps (help "death to ships"))
  28.  
  29. (define o fuel)
  30. (define a ammo)
  31. (define A shell)
  32. (define b bomb)
  33. (define ! torps)
  34.  
  35. (terrain-type sea (char ".") (color "sky blue"))
  36. (terrain-type atoll (char ",") (color "cyan"))
  37. (terrain-type island (char "+") (color "forest green") (image-name "forest"))
  38.  
  39. (add f image-name "1e")
  40. (add d image-name "1e")
  41. (add t image-name "torp-bomber")
  42. (add cl image-name "ca")
  43. (add cve image-name "cv")
  44. (add / image-name "airbase")
  45.  
  46. (define combat-air (f d t))
  47. (define air (f d t pby))
  48. (define heavy (cl ca bb))
  49. (define carriers (cve cv))
  50. (define ships (dd sub cve cl ca cv bb))
  51.  
  52. ;;; Any number of aircraft can share the same airspace.
  53.  
  54. (table unit-size-in-terrain
  55.   (air t* 0)
  56.   )
  57.  
  58. (table unit-size-as-occupant
  59.   (u* u* 99)
  60.   (air carriers 1)
  61.   (air / 4)
  62.   (ships / 1)
  63.   )
  64.  
  65. (add air capacity 0)
  66. (add carriers capacity (4 8))
  67. (add / capacity 32)
  68.  
  69. ;100 u* u* enter-time
  70.  
  71. (table unit-storage-x
  72.   (ships (fuel ammo) 500)
  73.   (air fuel 24)
  74.   (pby fuel 48)
  75.   (air ammo 2)
  76.   (pby ammo 0)
  77.   (d b 2)
  78.   (t torps 2)
  79.   ((dd sub) torps 12)
  80.   (cve (b torps) 25)
  81.   (cv (b torps) 50)
  82.   (heavy shell 50)
  83.   (/ m* 1000)
  84.   )
  85.  
  86. (table base-consumption
  87.   (air fuel 12)
  88.   (pby fuel  6)
  89.   (ships fuel 1)
  90.   )
  91.  
  92. (table hp-per-starve
  93.   ;; Aircraft splash immediately if they run out of fuel.
  94.   (air fuel 1.00)
  95.   ;; Ships have a short grace period.
  96.   (ships fuel 0.10)
  97.   )
  98.  
  99. (set terrain-seen true)
  100. (add / already-seen 100)
  101.  
  102. ;;; Actions.
  103.  
  104. (add air acp-per-turn 12)
  105. (add pby acp-per-turn 6)
  106. (add ships acp-per-turn 3)
  107.  
  108. (add / acp-per-turn 0)
  109.  
  110. ;;; Movement.
  111.  
  112. (add / speed 0)
  113.  
  114. (table mp-to-enter-terrain
  115.   (ships atoll 2)
  116.   (ships island 10)
  117.   )
  118.  
  119. ;; Everybody needs fuel.
  120.  
  121. (table consumption-per-move
  122.   (u* fuel 1)
  123.   )
  124.  
  125. ;10 sub visibility
  126.  
  127. (add ships hp-max (5 5 5 5 10 10 20))
  128. (add / hp-max 100)
  129.  
  130. (table acp-to-attack
  131.   (air u* 3)
  132.   )
  133.  
  134. (table hit-chance
  135.   (u* u* 50)
  136.   (f air 80)
  137.   (f f 60)
  138.   (pby u* 0)
  139.   (f carriers 20)
  140.   (sub air 20)
  141.   (dd sub 70)
  142.   (carriers u* 10)
  143.   ;; Only combat aircraft and heavy ships can hit the base.
  144.   (u* / 0)
  145.   ;; ...and they always hit.
  146.   (combat-air / 100)
  147.   (heavy / 100)
  148.   )
  149.  
  150. (table damage
  151.   (u* u* 1)
  152.   (pby u* 0)
  153.   (heavy u* 3)
  154.   ((t dd sub) ships 1d4+1)
  155.   ((t dd sub) (cv bb) 1d5+6)
  156.   (bb / 1d10+5)
  157.   )
  158.  
  159. (table consumption-per-attack
  160.   (air ammo 1)
  161.   (carriers ammo 1)
  162.   ((t dd sub) torps 1)
  163.   (heavy shell 1)
  164.   )
  165.  
  166. (table hit-by
  167.   (ships (b torps) 1)
  168.   (air ammo 1)
  169.   (u* shell 1)
  170.   )
  171.  
  172. ;50 air carriers protect
  173.  
  174. ;"sinks" ships destroy-message
  175. ;"shoots down" air destroy-message
  176.  
  177. ;; 0 air control
  178.  
  179. (game-module (notes (
  180.    "This is a somewhat expanded version of the navy in the standard game. "
  181.    "Each side commands a large fleet, and the sole objective is to wipe out "
  182.    "the enemy's fleet.  There are different kinds of planes and ships, but "
  183.    "nothing else."
  184.  
  185.    "Speeds of ships are uniform, so that formations work better (don't want "
  186.    "the carriers outstripping their escorts). "
  187.  
  188.    "You do *not* get complete control over the aircraft!  Those undisciplined "
  189.    "pilots just do what they feel like doing, and only take about half their "
  190.    "orders."
  191.   )))
  192.  
  193. (add t* alt-percentile-min (  0  96  98))
  194. (add t* alt-percentile-max ( 96  98 100))
  195. (add t* wet-percentile-min 0)
  196. (add t* wet-percentile-max 100)
  197.  
  198. (set edge-terrain sea)
  199.  
  200. (set country-radius-min 4)
  201. (set country-separation-min 30)
  202. (set country-separation-max 32)
  203.  
  204. (add u* start-with (8 8 8 4 6 2 4 2 2 2 2 1))
  205.  
  206. (table favored-terrain
  207.   (u* t* 0)
  208.   (ships sea 100)
  209.   (/ (atoll island) 100)
  210.   )
  211.  
  212. (set advantage-min 1)
  213. (set advantage-default 2)
  214. (set advantage-max 8)
  215.  
  216. ;;; Everybody starts out full.
  217.  
  218. (table unit-initial-supply (u* m* 9999))
  219.  
  220. ;; Note that there are no default namers for unit types, so any type
  221. ;; not mentioned in the side's own namers will simply not be named.
  222.  
  223. (set side-library '(
  224.   ((noun "American") (emblem-name "flag-usa")
  225.    (unit-namers
  226.     (cl "us-cl-names")
  227.     (ca "us-ca-names")
  228.     (cve "us-cve-names")
  229.     (cv "us-cv-names")
  230.     (bb "us-bb-names"))
  231.    )
  232.   ((noun "Japanese") (emblem-name "flag-japan")
  233.    (unit-namers
  234.     (ca "japanese-ca-names")
  235.     (cve "japanese-cve-names")
  236.     (cv "japanese-cv-names")
  237.     (bb "japanese-bb-names"))
  238.    )
  239.   ))
  240.  
  241. (include "ng-ships")
  242.  
  243. (scorekeeper (do last-side-wins))
  244.